package stack;

import java.util.Stack;

public class StackDemo {
	public static void main(String[] args) {
		Stack<Integer> stack = new Stack();
		stack.push(1);
		stack.add(2);
		stack.add(3);

		for (int x : stack) {

			System.out.println(x);

		}
		//出栈
		while (stack.size() > 0) {
			System.out.println(stack.pop());
		}
		System.out.println(stack.empty());
	}
}
